package com.kfm.pm.stream;

import java.util.Comparator;
import java.util.Objects;

public class HairStyle implements Comparable<HairStyle> {

    private String name;
    private double money;
    private String color;

    public HairStyle(String name, double money, String color) {
        this.name = name;
        this.money = money;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return "HairStyle{" +
                "name='" + name + '\'' +
                ", money=" + money +
                ", color='" + color + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        HairStyle hairStyle = (HairStyle) object;
        return Double.compare(money, hairStyle.money) == 0 && Objects.equals(name, hairStyle.name) && Objects.equals(color, hairStyle.color);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, money, color);
    }

    @Override
    public int compareTo(HairStyle o) {
        return Double.compare(o.money, money);
    }
}
